Inductive and Coinductive Techniques in the Operational Analysis of Functional Programs: an Introduction
نویسندگان
چکیده
Many works have shown that operational semantics is a useful framework for the formal study of programs properties. Our investigation takes as object of study a call-by-name variant of FPC, a functional language with higher order functions and recursive types. We show that by using Plotkin’s structural operational semantics it is possible to specify formal semantics for FPC for both convergent and divergent programs. Structural operational semantics can be specified by means of rules, therefore it allows to use induction and coinduction principles, to define objects and to reason about their properties. Two approaches are well known in giving structural operational semantics for programming languages: big-step and small-step. For a language like FPC they can be related by showing that they capture the same meaning. Furthermore, we show that it is possible to translate a proof in the big-step formalism in a proof in the small-step by adding some information to rules. Each formal theory of programming languages must analyze equality in-depth. In an operational setting, Morris’s style contextual equivalence is the widely accepted natural notion of equivalence for programs. Many properties of contextual equivalence can be proved by using simple proof principles. In particular, we prove two interesting properties, syntactic continuity and rational completeness. They can thought of as the syntactical counterparts of well-known notions in domain theory. Unfortunately, contextual equivalence is not straightforward to prove. Nevertheless it is coinductive in nature, for this reason it is interesting to find different formulations which permit to coinductively reason about program equality. We show that two classical programs equivalence notions, named experimental equivalence and bisimilarity respectively, coincide with contextual equiavalence for FPC. Finally we conclude by showing an example of how the theory developed in this work can be used in programming practice.
منابع مشابه
Extending Coinductive Logic Programming with Co-Facts
We introduce a generalized logic programming paradigm where programs, consisting of facts and rules with the usual syntax, can be enriched by co-facts, which syntactically resemble facts but have a special meaning. As in coinductive logic programming, interpretations are subsets of the complete Herbrand basis, including infinite terms. However, the intended meaning (declarative semantics) of a ...
متن کاملGlobal semantic typing for inductive and coinductive computing
Inductive and coinductive types are commonly construed as ontological (Church-style) types, denoting canonical data-sets such as natural numbers, lists, and streams. For various purposes, notably the study of programs in the context of global (“uninterpreted”) semantics, it is preferable to think of types as semantical properties (Curry-style). Intrinsic theories were introduced in the late 199...
متن کاملProgram extraction via typed realisability for induction and coinduction
We study a realisability interpretation for interleaved inductive and coinductive definitions and discuss its application to program extraction in constructive analysis. A speciality of this interpretation is that realisers are given by terms that correspond directly to programs in a lazy functional programming language such as Haskell.
متن کاملInductive and Coinductive Session Types in Higher-Order Concurrent Programs
We develop a theory of inductive and coinductive session types in a computational interpretation of linear logic, enabling the representation of potentially infinite interactions in a compositionally sound way that preserves logical soundness, a major stepping stone towards a full dependent type theory for expressing and reasoning about session-based concurrent higher order distributed programs...
متن کاملCoCaml: Functional Programming with Regular Coinductive Types
Functional languages offer a high level of abstraction, which results in programs that are elegant and easy to understand. Central to the development of functional programming are inductive and coinductive types and associated programming constructs, such as pattern-matching. Whereas inductive types have a long tradition and are well supported in most languages, coinductive types are subject of...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2004